<?php

namespace McWin\Model;
use Common\Model\CommonModel;

/**
 * 
 * 	内蒙古 k3 开奖记录
 */

class NmgK3OpenModel extends CommonModel {

	protected $trueTableName = 'cp_nmg_k3';
	
	/**
	 *	读取最新开奖记录
	 */
	public function read_open(){
		$where['time'] =  array('gt',date('Y-m-d'));
		$dd = $this -> where($where) -> order('qihao desc') -> limit(1) -> select();
		if($dd)
			return $dd[0];		
		else 
			return null;
	}

	/**
	 * [read_open_of_qishu description]
	 * @param  [type] $qishu [description]
	 * @return [type]        [description]
	 */
	public function read_open_of_qishu($qishu){
		$where['qihao'] =  $qishu;
		$dd = $this -> where($where) -> limit(1) -> select();
		if($dd)
			return $dd[0];		
		else 
			return null;
	}


}